package com.morphiastic.conversion;


/**
 * Converts a value as stored inside the ElasticSearch index
 * to its equivalent Java Object
 * @author Alex
 *
 * @param <K>
 */
public abstract class ElasticConverter<T>  {

	/**
	 * Converts an index value to the appropriate object
	 * @param val
	 * @return
	 */
	public abstract T fromIndexValue(Object val);
		
	/**
	 * Converts a java object to a string that can be passed to ElasticSearch for indexing
	 * @param value
	 * @return
	 */
	public abstract String toIndexValue(Object value);
	
}
